/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2012/08/30
* File: AnimationTrack.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#ifndef AnimationTrack_h__
#define AnimationTrack_h__

#include "../Core/Core.h"
#include "../Core/Declare.h"

class AniKeyFrame;
class AnimationTrack
{
	typedef std::vector<AniKeyFrame*> KeyFrameList;
public:
	AnimationTrack();
	virtual ~AnimationTrack();

public:
	AniKeyFrame* createKeyFrame(f32 time);
	AniKeyFrame* addKeyFrame(f32 time);
	AniKeyFrame* getKeyFrame(int idx);
	void removeKeyFrame(int idx);
	AniKeyFrame getInterpolatedKeyFrame(f32 time);

	void setEnable(bool enable);
	bool isEnable() const;

protected:
	void sortKeyFrameList();

protected:
	KeyFrameList		_key_frame_list;
	bool				_enable;
};
#endif    /* AnimationTrack_h__ */